<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul>
    <li>001</li>
    <li>002</li>
    <li>003</li>
  </ul>
  <script>
    const arr1 = [1, 2, 3]
    const arr2 = [4, 5, 6]

    // const arr3 = arr1.concat(arr2)
    const arr3 = [...arr1, 666, ...arr2]
    console.log(arr3);

    // 浅拷贝
    const arr4 = [...arr1]

    const obj1 = { name: 'lisi' }
    const obj2 = { age: 10, name: 'wangwu' }
    const obj3 = { ...obj1, ...obj2 }
    console.log(obj3);

    let aLi = document.querySelectorAll('li')
    aLi = [...aLi]
    aLi.push(666)
    console.log(aLi);


    function fn3(a, b, c, ...rest) {
      // console.log(arguments);
      console.log(rest)
    }
    fn3(1, 2, 3, 4, 5)
  </script>
</body>

</html>